<?php 	$p=permissionController::singleton();?>
<div id="page">

<div id="content">

<form action=<?php echo BASE_PATH;?>Laureato/View_search/ method='get'>
<select name="ricerca" id="ricerca">
<option value="all">Tutti</option>
<option value="matricola">Matricola</option>
<option value="nc">Nome Cognome</option>
</select>
 <input type="text" name="data" id="data" size="9"/>
 <input type="submit" value="Cerca"></form>
 

<br>
	<table>
		<tr>
			<th>Matricola</th>
			<th>Nome</th>
			<th>Cognome</th>
			<th>Email</th>
			<th>Data di <br>
			Nascita</th>
			<th>Relatore</th>
			<th>Anno di <br> 
			immatricozione</th>
			<th>Tesi</th>
			<?php 
			$uri['controller']="Laureato";
			$uri['method']="openViewUpadateLaureato";
			if($p->permission($uri)){ ?>
			<th>Modifica</th>
			<?php }?>
			<?php 
			$uri['controller']="Laureato";
			$uri['method']="Delete_Laureato";
			if($p->permission($uri)){ ?>
			<th>Cancella</th>
			<?php }?>
		</tr>
		<?php
		foreach ($vars as $result){
			echo "<tr>
					<td >"
						.$result[Matricola]."
					</td>
					<td >"
						.$result[Nome]."
					</td>
					<td >"
						.$result[Cognome]."
					</td>
						<td >"
						.$result[Email]."
					</td>
						<td >"
						.$result['Data di nascita']."
					</td>
						<td >"
						.$result[Relatore]."
					</td>
						<td >"
						.$result['Anno immatricolazione']."
					</td>
						<td >"
						.$result[Tesi]."
					</td>";
					
			$uri['controller']="Laureato";
			$uri['method']="Upadate_openViewUpadateLaureato";
			if($p->permission($uri)){	
					echo "<td>
						<a  href='".BASE_PATH."Laureato/openViewUpadateLaureato/?matricola=".$result[Matricola]."'>
							<img src='".BASE_PATH."application/view/image/modifica.jpg' border='0'>
						</a>
					</td>";
			}
					
			$uri['controller']="Laureato";
			$uri['method']="Delete_Laureato";
			if($p->permission($uri)){
					echo "<td>
						<a  href='".BASE_PATH."Laureato/Delete_Laureato/?matricola=".$result[Matricola]."'>
							<img src='".BASE_PATH."application/view/image/esci.png' border='0'>
						</a></td>";
			}
			echo    "</tr>";
		}

		?>
		
		
		
		
	</table>
	<br>

		
</div>
</div>
